/**
 * 鱼塘表
 */
class FishPondTpl{
    private static _instance:FishPondTpl = null;
    private data;

    public constructor()
    {
        this.data = JsonUtil.getData('fishPond_json');
    }

    public static instance()
    {
        if(!this._instance)
        {
            this._instance = new FishPondTpl();
        }
        return this._instance;
    }

    //通过深度获取该深度以上的所有数据
    public getDataByDepth(Depth:number)
    {
        let fishArr = [];

        for(let v of this.data)
        {
            let DepthArea = v['depth'];
            let arr = DepthArea.split('_');
            if(Depth < parseInt(arr[0]))
            {
                break;
            }
            else if(Depth > parseInt(arr[1]))
            {
                fishArr.push(v);
                continue;
            }
            else
            {
                fishArr.push(v);
                break;
            }
        }
        
        return fishArr;
    }
}